<template>
	<view class="page-w">
		<view class="search-box">
			<view class="search-bar">
				<view class="flex_bd">
					<input type="text" class="search-input" placeholder="快速搜索患者身份信息" />
				</view>
				<button type="default" class="search-btn" @click="show = true">搜索</button>
			</view>
		</view>
		<!-- list -->
		<view class="inspect-warp">
			<view class="filter-cell flex-center justify-zBetween">
				<view class="fil-title">患者列表</view>
				<view class="fil-tip">
					<view class="fil-tip-bar" @click="tClick">
						<text>说明</text><text class="iconfont icon-tishi"></text>
					</view>
					<view class="fil-dropment right" v-if="tipshow">
						<view class="fil-item flex-center">
							<view class="flex_bd"><text>导管4h过期或已过期</text></view><text style="background-color: #f34b33;"
								class="dot"></text>
						</view>
						<view class="fil-item flex-center">
							<view class="flex_bd"><text>24h内过期导管</text></view><text style="background-color: #ffa200;"
								class="dot"></text>
						</view>
						<view class="fil-item flex-center">
							<view class="flex_bd"><text>所有正常导管</text></view><text style="background-color: #19bc6f;"
								class="dot"></text>
						</view>
					</view>
				</view>
			</view>

			<view class="bed-cells">
				<u-row gutter="16">
					<u-col span="3">
						<view class="bed-card bed-danger-bg">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box box-danger">巡检异常12/2</view>
							</view>
							<view class="n text-danger">01</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box">巡检正常</view>
							</view>
							<view class="n">02</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box">巡检正常</view>
							</view>
							<view class="n">03</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box">巡检正常</view>
							</view>
							<view class="n">04</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box">巡检正常</view>
							</view>
							<view class="n">05</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box box-success">巡检正常</view>
							</view>
							<view class="n text-success">06</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box box-warning">待巡检</view>
							</view>
							<view class="n text-warning">07</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box box-danger">巡检异常15/9</view>
							</view>
							<view class="n text-danger">08</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box">巡检正常</view>
							</view>
							<view class="n">09</view>
						</view>
					</u-col>
					<u-col span="3">
						<view class="bed-card">
							<view class="bed-hd">A1床</view>
							<view class="u-name">杨飘逸</view>
							<view class="bed-bar">
								<view class="box box-success">巡检正常</view>
							</view>
							<view class="n text-success">10</view>
						</view>
					</u-col>
				</u-row>
			</view>
		</view>
		<u-popup v-model="show" mode="bottom" border-radius="30" height="410rpx" :closeable="true">
			<view class="inspect-popup">
				<view class="inspect-popup__hd">
					<view class="inspect-popup__title">
						巡检品类
					</view>
				</view>
				<view class="inspect-popup__bd">
					<view class="inspect-popup__list clearfix">
						<view class="item" :class="{active:flag == index}" v-for="(item,index) in list" :key="index"
							@click="pClick(index)">
							<view class="inspect-popup__btn">{{item}}</view>
						</view>

					</view>
				</view>
			</view>

		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tipshow: false,
				show: false,
				list: ['导管巡检', '导管巡检', '导管巡检', '导管巡检', '导管巡检', '导管巡检'],
				flag: 0
			}
		},
		onLoad() {

		},
		methods: {
			tClick() {
				this.tipshow = !this.tipshow
			},
			pClick(index) {
				this.flag = index
			}

		}
	}
</script>

<style lang="scss">
	.page-w{
		background-color: #FFFFFF;
		min-height: 100vh;
	}
	.inspect-warp {
		background-color: #fff;
		padding: 0 30rpx;
	}

	.search-box {
		padding: 30rpx 50rpx;
		border-bottom: 10rpx solid #f9f9f9;
		background-color: #fff;
	}

	.search-bar {
		display: flex;
		align-items: center;
		border: 2rpx solid #eeeeee;
		border-radius: 36rpx;
		height: 72rpx;

		.search-input {
			font-size: 26rpx;
			height: 68rpx;
			line-height: 40rpx;
			padding: 14rpx 30rpx;
		}

		.search-btn {
			width: 106rpx;
			height: 68rpx;
			font-size: 26rpx;
			color: #fff;
			padding: 0;
			margin: 0;
			line-height: 68rpx;
			border-radius: 0 34rpx 34rpx 0;
			background-color: #009fe8;
		}

		.search-btn::after {
			display: none;
		}
	}

	.fil-dropment {
		padding: 10rpx 18rpx;
		border-radius: 10rpx;
		box-shadow: 0 0 10px rgba(0, 64, 116, .24);
		position: absolute;
		top: 60rpx;
		right: 0;
		background-color: #FFFFFF;
		width: 260rpx;

		.fil-item {
			display: flex;
			align-items: center;
			padding: 20rpx 0;
			color: #373b4f;
			font-size: 26rpx;
			border-bottom: 1px solid #eeeeee;
		}

		.fil-item:last-child {
			border-bottom: 0;
		}

		&::after {
			width: 10px;
			height: 10px;
			background-color: #FFFFFF;
			content: '';
			position: absolute;
			top: -10rpx;
			left: 50%;
			transform: rotateZ(45deg);
		}
	}

	.fil-dropment.right {
		right: 0;
		width: 330rpx;

		.dot {
			display: block;
			width: 24rpx;
			height: 24rpx;
			border-radius: 24rpx;
		}

		&::after {
			left: auto;
			right: 40rpx;
		}
	}

	.filter-cell {
		position: relative;
		z-index: 99;
		padding: 30rpx 0;
		line-height: 1.2;

		.fil-title {
			font-weight: bold;
			font-size: 34rpx;
		}

		.fil-tip {
			position: relative;

			.fil-tip-bar {
				background-color: #e9f1fa;
				color: #2673cb;
				height: 36rpx;
				line-height: 36rpx;
				padding: 0 10rpx;
				border-radius: 3px;
				font-size: 24rpx;

				.iconfont {
					font-size: 24rpx;
					padding-left: 3px;
				}
			}
		}
	}

	.bed-cells {
		margin: 0 -8rpx;
	}

	.bed-card {
		position: relative;
		margin-bottom: 1;
		line-height: 1.2;
		padding: 20rpx 12rpx;
		margin-bottom: 16rpx;
		height: 166rpx;
		border-radius: 12px;
		background-color: #f6f6f8;
		overflow: hidden;

		.n {
			position: absolute;
			right: 1px;
			top: 1px;
			font-size: 22rpx;
			width: 40rpx;
			height: 40rpx;
			background-color: #FFFFFF;
			border-radius: 0 12rpx 0 12rpx;
			color: #00a4e8;
			text-align: center;
			line-height: 40rpx;

		}

		.bed-hd {
			color: #596371;
			font-size: 26rpx;
			height: 52rpx;
		}

		.u-name {
			color: #373b4f;
			font-size: 28rpx;
			font-weight: bold;
			margin-bottom: 10rpx;
		}

		.bed-bar {
			display: flex;
			position: absolute;
			bottom: 0;
			left: 0;
			right: 0;

			.box {
				width: 100%;
				height: 36rpx;
				text-align: center;
				line-height: 36rpx;
				border-radius: 0 0 12rpx 12rpx;
				background-color: #e5f0fe;
				color: #00a4e8;
				font-size: 22rpx;
			}

			.box-warning {
				background-color: #fff2db;
				color: #ffa200;
			}

			.box-success {
				background-color: #e5fef3;
				color: #19bc6f;
			}

			.box-danger {
				background-color: #fee5e5;
				color: #f84949;
			}
		}

	}

	.text-danger {
		color: #f92a2a !important;
	}

	.text-warning {
		color: #ff8400 !important;
	}

	.text-success {
		color: #0dbf72 !important;
	}

	.bed-danger-bg {
		background-color: #fff4f4;
	}

	.inspect-popup__hd {
		padding: 30rpx;
		border-bottom: 1rpx solid #EEEEEE;

		.inspect-popup__title {
			color: #333333;
			font-size: 34rpx;
			line-height: 40rpx;
		}
	}

	.inspect-popup__bd {
		padding: 30rpx 40rpx;

		.inspect-popup__list {
			margin: 0 -20rpx;
			
			.item {
				float: left;
				padding: 0 20rpx;
				width: 33.3333%;
			}
			
			.item.active .inspect-popup__btn{
				background-color: #009fe8;
				border-color: #009fe8;
				color: #fff;
			}
			
			.inspect-popup__btn{
				height: 70rpx;
				text-align: center;
				line-height: 70rpx;
				border: 1rpx solid #e5e5e5;
				border-radius: 8rpx;
				font-size: 30rpx;
				color: #999999;
				margin-bottom: 40rpx;
			}
		}
	}
</style>
